﻿/*
 * Created by SharpDevelop.
 * User: mac
 * Date: 21.07.2006
 * Time: 20:06
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using TagTool.Core;

namespace TagTool.Nodes.Math
{
	public class Trigger : BaseNode
	{
		private InputSlot slotA;
		bool oldValue = false;
		
		public Trigger()
		{
			Name = "Trigger";
			slotA = new InputSlot(this, "Input signal", new Object());
		}
		
		[NodeAttribute(SlotType.Input, Show = true)]
		public InputSlot InputSignal
		{
			get { return slotA; }
		}
	
		public override void Update(Object sender)
		{
			if (oldValue)
			{
            	CastTrigger();
			}
			
			oldValue = !oldValue;
		}
	}
}
